import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/v1_0/authorizations',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

export function getChannel() {
  return request({
    url: '/v1_0/channels'
  })
}

export function getProfile() {
  return request({
    url: '/v1_0/user/profile'
  })
}

export function getArticles() {
  return request({
    url: '/v1_0/mp/articles'
  })
}
export function userDelete(id) {
  return request({
    url: `/v1_0/mp/articles/${id}`,
    method: 'DELETE'
  })
}
export function screen(params) {
  return request({
    url: '/v1_0/mp/articles',
    params
  })
}
